﻿// -----------------------------------------------------------------------
// <copyright file="FriendsQuery.cs" company="Hewlett-Packard">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Ex3.Logic
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using FacebookWrapper.ObjectModel;

    /// <summary>
    /// Queries
    /// </summary>
    public class FriendsQuery 
    {
        public static User GetFriendsByName(string Name, User i_LoggedInUser)
        {
            User SearchFriend = null;

            foreach (User currenFriend in i_LoggedInUser.Friends)
            {
                if (currenFriend.Name.Equals(Name))
                {
                    SearchFriend = currenFriend;
                }
            }

            return SearchFriend;
        }
    }
}
